package com.khyr.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.khyr.entity.LoginInfo;
import com.khyr.service.LoginInfoService;
import com.khyr.vo.LoginInfoVo;
import com.khyr.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 宋一恒
 * @version 1.0
 */
@RestController
@RequestMapping("/systemManager/loginInfo")
public class LoginInfoController {
    @Autowired
    private LoginInfoService loginInfoService;
    // 查询所有登录信息
    @PostMapping("/selectAllLoginInfoByCond")
    public R<Page<LoginInfo>> selectAllLoginInfoByCond(@RequestBody LoginInfoVo loginInfoVo){
        return loginInfoService.selectAllLoginInfoByCond(loginInfoVo);
    }

    //删除
    @DeleteMapping("/deleteLoginInfoByLoginInfoIds/{ids}")
    public R<Integer> deleteLoginInfoByLoginInfoIds(@PathVariable List<Long> ids){
        return loginInfoService.deleteLoginInfoByLoginInfoIds(ids);
    }

    //清空
    @DeleteMapping("/clearLoginInfo")
    public R<Integer> clearLoginInfo(){
        return loginInfoService.clearLoginInfo();
    }

}
